]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st-entry: Disable middle-click-paste when entry is not editable
authorMichael Catanzaro <mcatanzaro@igalia.com>
Tue, 23 Feb 2016 02:46:00 +0000 (20:46 -0600)
committerMichael Catanzaro <mcatanzaro@gnome.org>
Tue, 23 Feb 2016 12:48:50 +0000 (06:48 -0600)
Should only allow pasting the primary selection when the entry is
editable.

https://bugzilla.gnome.org/show_bug.cgi?id=762507

src/st/st-entry.c

index c1a648d354991f89a5658300787d1973df6b3eb5..77fabc81251f938f97d9a6ef12a40909fa3166e2 100644 (file)
@@ -566,6 +566,7 @@ clutter_text_button_press_event (ClutterActor       *actor,
                                  ClutterButtonEvent *event,
                                  gpointer            user_data)
 {
+  StEntryPrivate *priv = ST_ENTRY_PRIV (user_data);
   GtkSettings *settings = gtk_settings_get_default ();
   gboolean primary_paste_enabled;
 
@@ -573,7 +574,8 @@ clutter_text_button_press_event (ClutterActor       *actor,
                 "gtk-enable-primary-paste", &primary_paste_enabled,
                 NULL);
 
-  if (primary_paste_enabled && event->button == 2)
+  if (primary_paste_enabled && event->button == 2
+      && clutter_text_get_editable (CLUTTER_TEXT (priv->entry)))
     {
       StClipboard *clipboard;